from fastapi import APIRouter, Request
from controllers.social_auth_controller import SocialAuthController

social_auth_router = APIRouter()

@social_auth_router.get("/{provider}/login")
async def social_login(provider: str):
    """社交登录入口"""
    return await SocialAuthController.login(provider)

@social_auth_router.get("/{provider}/callback")
async def social_callback(provider: str, request: Request, code: str = None):
    """社交登录回调"""
    return await SocialAuthController.callback(provider, request, code)